var mouse_X = 0;
var mouse_Y = 0;
function mouseMove(evt){
	mouse_X = evt.pageX - canvas.offsetLeft;
	mouse_Y = evt.pageY - canvas.offsetTop;
}
	
function mouseDown(evt){
	var a = 0;
	var b = 0;
	var c = 0;
	var d = 0;
	if (mouse_X>(hero.getX()+hero.getWidth()/2)) { c = 1; a = 0; }
	if (mouse_X<(hero.getX()+hero.getWidth()/2)) { c = 0; a = 1; }
	if (mouse_X==(hero.getX()+hero.getWidth()/2)) { c = 0; a = 0; }
	if (mouse_Y>(hero.getY()+hero.getHeight()/2)) { d = 1; b = 0; }
	if (mouse_Y<(hero.getY()+hero.getHeight()/2)) { d = 0; b = 1; }
	if (mouse_Y==(hero.getY()+hero.getHeight()/2)) { d = 0; b = 0; }
	hero.move(ctx, a,b,c,d);
	CheckBarrier(hero, 0, 0, scope_width, scope_height);
	CheckItem(hero, items);
}